<?php
namespace Pay\Controller;
use Think\Controller;
class IndexController extends Controller {


    public function index(){
        $map['id'] =5;
        $info = M('alipay')->where($map)->find();
        $this->assign('info',$info);
        $this->display();

    }

    public function payto(){
        if(IS_POST){
           // $data['subject']=$_POST('subject');
          //  $data['out_trade_no']=$_POST('out_trade_no');
          //  $data['total_fee']=$_POST('total_fee');

            $data['subject']=I('post.subject');
            $data['out_trade_no']=I('post.out_trade_no');
            $data['total_fee']=I('post.total_fee');

           // $res = new \Common\Model\PayModel();
           // $a = $res->alipay($data);
            $res = D('Common/Pay')->alipay($data);
            $this->ajaxReturn($res);//默认返回json

        }

    }



}